﻿var h= window.screen.height,w=window.screen.width;
//var gobalAddr=document.domain+':'+location.port;
var gobalAddr="140.210.6.180";
var radialObj;
var total=200,d1,d2,d3,d4,o1,o2,dgtotal,obj1,obj2,obj3,obj4;
var chart_timer,myChart,option;

function  isNull(v) {
    if(v==null||v==""){
        v=0;
    }
    return v;
}
$(function(){
    weather_date('连云港');
    ///折线图
    chart_timer=null;
    myChart = echarts.init(document.getElementById('main1'));
    option = {
        title : {
            text: '借出、还入曲线图',
            textStyle:{
                color: '#8fa1ba'
            }
        },
        tooltip : {
            trigger: 'axis'
        },
        legend: {
            data:['借出','还入'],
            x:'right',
            textStyle:{
                color: '#98a8c2',
                fontSize:14
            }
        },
        grid:{
            x:40,
            x2:15,
            y:45
        },
        color:['#62ca5f','#e8a20d'],
        calculable : true,
        xAxis : [
            {
                type : 'category',
                boundaryGap:true,
                axisLine:{
                    lineStyle:{
                        color: '#404155',
                        width: 1
                    },
                    onZero:true
                },
                splitLine:{
                    show:true,
                    lineStyle:{
                        color: '#404155'
                    },
                },
                axisLabel:{
                    interval:0,
                    textStyle: {
                        color:'#98a8c2'
                    }
                },
                data : ["08:00","09:00","10:00","11:00"]
            }
        ],
        yAxis : [
            {
                type : 'value',
                axisLine:{
                    lineStyle:{
                        color: '#404155',
                        width: 1
                    }
                },
                boundaryGap:true,
                splitLine:{
                    lineStyle:{
                        color: '#404155'
                    }
                },
                axisLabel : {
                    show:true,
                    formatter: '{value}',
                    textStyle: {
                        color:'#98a8c2'
                    }
                }
            }
        ],
        series : [
            {
                name:'借出',
                type:'line',
                symbolSize : 8,
                smooth: true,
                label: {
                    normal: {
                        show: true,
                        position:  'left',
                    }
                },
                animationDelay: function (idx) {
                    return idx * 10 + 100;
                },
                itemStyle:{
                    normal:{
                        lineStyle:{
                            type: 'solid'
                        }
                    }
                },
                /*markLine : {
                 itemStyle:{
                 normal:{
                 lineStyle:{
                 type: 'dashed'
                 }
                 }
                 },
                 data : [
                 // [0,{type : 'min'}]
                 ]
                 },*/
                data : [11,23,41,62]
            },
            {
                name:'还入',
                type:'line',
                label: {
                    normal: {
                        show: true,
                        position: 'right',//'insideBottomRight'[5, 10]
                    }
                },
                itemStyle:{
                    normal:{
                        lineStyle:{
                            type: 'solid'
                        }
                    }
                },
                /* markLine : {
                 itemStyle:{
                 normal:{
                 lineStyle:{
                 type: 'dashed'
                 }
                 }
                 },
                 data : [
                 []
                 ]
                 },*/
                symbolSize : 8,
                smooth: true,
                animationDelay: function (idx) {
                    return idx * 10;
                },
                data : [8,21,39,53]
            }
        ],
        animationEasing: 'elasticOut',
        animationDelayUpdate: function (idx) {
            return idx * 5;
        }
    };
    //var chart_clear_flag=false;


    getweather($("#place").text().trim());
    $('.zy-Slide1').zySlide({ speed: 500 }).css('border', '0px solid blue');
    library_num_move();//到馆统计
    select_style();///本馆风采
    borrow_num_move();//借还书数字变化
    chart_move();//折线图
    /////今日推荐
    radialObj=radialIndicator('#indicatorContainer' , {
        barColor: '#fff',
        barBgColor: '#2f2f3a',
        initValue:0,
        minValue: 0,
        barWidth: 3/1080*h,
        maxValue: 300,
        fontSize:1/1080*h,
        radius: 50.5/1920*w,
        format:' 人'
    });
    $('.zy-Slide2').zySlide({ speed: 500,type:2,delay: 6000}).css('border', '0px solid blue');
    getchange();
    startTime();////圆环不断加载
    notice_move();//通知

});
/////天气
function getweather(p){
    $.ajax({
        url:"http://api.map.baidu.com/telematics/v3/weather",
        type:"get",
        data:{
            location:p,
            output:'json',
            ak:'6tYzTvGZSOpYB5Oc2YGGOKt8'
        },
        /*预期服务器端返回的数据类型，假设我现在跨域了，我就改成jsonp 就可以了 */
        dataType:"jsonp",
        success:function(data){
            var weatherData=data.results[0].weather_data;
            $("#place").text(p);
            if(weatherData[0].weather.length!=undefined&&weatherData[0].weather.length>=6){
                $(".hw_left").width(10/192*w);
            }
            $(".hw_left li:nth-child(2)").text(weatherData[0].weather);
            $(".hw_left li:last-child").text(weatherData[0].temperature);
        }
    })
}

function chart_move(){
    clearTimeout(chart_timer);
    //if(chart_clear_flag){
    //    myChart.clear();
    //}
    myChart.clear();
    myChart.setOption(option);
    //if(!chart_clear_flag){
    //    chart_clear_flag=true;
    //}
    chart_timer=setTimeout('chart_move()',8000);
}
///折线图结束


///到馆统计
var library_timer=null;
function library_num_move(){
    clearTimeout(library_timer);////每次循环都把上一次的定时器清除
    obj1 = $(".dg1 .timer");
    obj2 = $(".dg2 .timer");
    obj3 = $(".dg3 .timer");
    $(".lbar-warp .timer").hide();
    $(".lbar-warp .timer").height(0);
    $(".lbar-warp .timer").show();
    obj1.height((89/total)*100+"%");
    obj2.height((51/total)*100+"%");
    obj3.height((399/(total*7))*100+"%");
    //$(".b-content-ub .timer").width((v24/(total*parseInt(diff)))*100+"%");
    $(".box21.timer").addClass('active');
    d1 = new CountUp($(".dg1 .timer"), 0, 89, 0, 3, op2);
    d2 = new CountUp($(".dg2 .timer"), 0, 51, 0, 3, op2);
    d3 = new CountUp($(".dg3 .timer"), 0, 399, 0, 3, op2);
    d4 = new CountUp($(".b-content-ub .timer"), 0, 1851123, 0, 3, op3);
    d1.start();
    d2.start();
    d3.start();
    d4.start();
    library_timer=setTimeout('library_num_move()',10000);
}

///本馆风采
function select_style(){
    var flag=1;////默认标志为1说明是轮播图片，当为2时候说明轮播视频
    var str='';
    if(flag==1){
        str='<div class="swiper-wrapper">'+
            '<div class="swiper-slide"><img src="upload/0.jpg" alt="" title="" height="100%"/></div>'+
            '<div class="swiper-slide"><img src="upload/1.JPG" alt="" title="" /></div>'+
            '<div class="swiper-slide"><img src="upload/2.JPG" alt="" title="" /></div>'+
            '<div class="swiper-slide"><img src="upload/4.JPG" alt="" title="" /></div>'+
            '<div class="swiper-slide"><img src="upload/5.JPG" alt="" title="" height="100%"/></div>'+
            '</div>'+
            '<div class="swiper-pagination" style="background-color:rgba(76,113,168,0.8);text-align: center;bottom:0">' +
            '</div>';
        $('.swiper-container').html(str);
        var swiper = new Swiper('.swiper-container', {
            pagination: '.swiper-pagination',
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
            slidesPerView: 1,
            paginationClickable: true,
            spaceBetween: 30,
            loop: true,
            autoplay: 4000,
        });

    }
    if(flag==2){
        str='<div id="banner_video_all"><video controls width="100%",height="100%" id="banner_video_01"><source src="./flv.flv" type="video/flv"><source src="upload/chrome.mp4" type="video/mp4"></video></div>';
        $('.swiper-container').html(str);
        var vList = ['upload/chrome.mp4', 'upload/mp4.mp4']; // 初始化播放列表
        var vLen = vList.length;
        var curr = 0;
        var video = document.getElementById("banner_video_01");
        video.play();
        video.addEventListener('ended', function(){
            play();
        });
        function play() {
            video.src = vList[curr];
            video.load();
            video.play();
            curr++;
            if(curr >= vLen){
                curr = 0; //重新循环播放
            }

        }
    }
}///本馆风采结束

///借还书数字变化
var op1={suffix:'册'}, op2={suffix:'人次'}, op3={suffix:'人次 '};
var t1,t2,t3,borrow_timer=null;
function borrow_num_move(){
    clearTimeout(borrow_timer);
    t1 = new CountUp($(".tjread1 .timer"), 0, 62,0,4,op1);
    t2 = new CountUp($(".tjread2 .timer"), 0, 686,0,4,op1);
    t3 = new CountUp($(".tjread3 .timer"), 0, 14351,0,4,op1);
    t1.start();t2.start();t3.start();
    borrow_timer=setTimeout('borrow_num_move()',12000);
}
////借还书数字变化结束


///今日推荐
var startTime_timer;
function getchange(){
    $(".zy-Slide2 li").each(function (i, el) {
        if($(el).css("z-index")==2){
            var num=$(el).find("img").attr("data-to");
            var total=$(el).find("img").attr("data-total");
            if(total==""||total===undefined){total=300;}
            //radialObj.value(parseInt(num),parseInt(total));
            radialObj.animate(num);
        }
    });
}
function startTime() {
    /////天气
    var today = new Date(); //定义日期对象
    var ss = today.getSeconds(); //通过日期对象的getSeconds方法返回秒
    var yyyy = today.getFullYear(); //通过日期对象的getFullYear()方法返回年
    var MM = today.getMonth() + 1; //通过日期对象的getMonth()方法返回年
    var dd = today.getDate(); //通过日期对象的getDate()方法返回年
    var hh = today.getHours(); //通过日期对象的getHours方法返回小时
    var mm = today.getMinutes(); //通过日期对象的getMinutes方法返回分钟
    // 如果分钟或小时的值小于10，则在其值前加0，比如如果时间是下午3点20分9秒的话，则显示15：20：09
    MM = checkTime(MM);
    dd = checkTime(dd);
    mm = checkTime(mm);
    ss = checkTime(ss);
    var day; //用于保存星期（getDay()方法得到星期编号）
    if (today.getDay() == 0) day = "星期日 "
    if (today.getDay() == 1) day = "星期一 "
    if (today.getDay() == 2) day = "星期二 "
    if (today.getDay() == 3) day = "星期三 "
    if (today.getDay() == 4) day = "星期四 "
    if (today.getDay() == 5) day = "星期五 "
    if (today.getDay() == 6) day = "星期六 "
    $(".hw_right li").text(yyyy+"年"+MM+"月"+dd+"日 "+day);
    $(".hw_right b").text(checkTime(hh)+":"+mm);
    $(".hw_right span").text(ss);
    /////天气结束
    clearTimeout(startTime_timer);
    getchange();
    startTime_timer=setTimeout('startTime()', 1000); //每一秒中重新加载startTime()方法
}
function checkTime(i) {
    if (i < 10) {
        i = "0" + i;
    }
    return i;
}////判断是否小于0
///今日推荐结束

///通知
    var arr=["南京医科大学康达学院图书馆建于2000年5月，与南京医科大学图书馆资源共建共享，是江苏省馆藏文献资源较为丰富的民办本科图书馆之一。于2013年9月搬迁至连云港康达学院校区。康达学院图书馆是南京医科大学图书馆连云港分馆，同时也是南京医科大学医学科技信息研究中心连云港分中心。图书馆建筑面积：图书馆现有馆舍面积约1.3万多平方米。馆藏量：本馆现有馆藏资源总量75万余册。其中中外文图书33万余册、合订本期刊1.3万册；电子图书40.6万余册；中外文报刊648种；2000多集基础医学、护理学、药学、管理学等学科的学术视频资料。本馆还收藏有《中国知网》、《万方数据》、《维普期刊数据库》、<维普考试题库》、《银符考试模拟题库》、《中科软股考试库》、《软件通》、《超星数字图书馆》等15种数据库以及与南医大图书馆共建共享的《中国生物医学文献服务系统》、《ProQuest欧美博硕士论文全文数据库》等70多个数据库。"];
    var brr=["康达学院图书馆"];
    var index=0;
    var ul_height;
    var box_height;
    var str;
    var i=0;
    var timer=null;
    function notice_move(){
        i=0;
        clearTimeout(timer);
        ////每次定时器进来都清空内容
        if(index==2){
            //str="<ul style='position: absolute;left:0;top:0;color: #4bc1fe;'><li style='width: 3.6rem;margin:0 auto 0.1rem 1rem;line-height: 0.32rem;'>"+arr[index][0]+"</li><li style='width: 3.6rem;margin:0 auto 0.1rem 1rem;line-height: 0.32rem;'>"+arr[index][1]+"</li><li style='width: 3.6rem;margin:0 auto 0.1rem 1rem;line-height: 0.32rem;'>"+arr[index][2]+"</li></ul>";
            str="<div style='position: absolute;left:0;top:0;color: #a1adcf;'><p>"+arr[index][0]+"</p><p>"+arr[index][1]+"</p><p>"+arr[index][2]+"</p></div>";
        }else{
            str="<div style='position: absolute;left:0;top:0;color: #a1adcf;text-indent: 36px;'><p>"+arr[index]+"</p></div>";
        }
        //var str1="<li style='text-indent: 0.32rem;margin-bottom: 0.1rem;'>"+arr[index]+"</li>";
        $(".myBlock_inner").html(str);
        $('.b32-header').html(brr[index]);//赋值当前通知的标题
        $(".myBlock_inner").css("position","relative");
        ul_height=$('.myBlock_inner>div').height();
        box_height=$('.myBlock_inner').height();
//            console.log(index,ul_height);
        if($('.myBlock_inner>div').height()>$('.myBlock_inner').height()){
            //$('.myBlock_inner>ul').append(str1);
            var scrollTime=ul_height/10*1000;
            if(scrollTime>10000){
                i=scrollTime/10000-1;
            }
            //console.log(scrollTime);
            $('.myBlock_inner>div').animate({top:-ul_height},scrollTime,"linear");
        }
        index++;
        if(index==arr.length){
            index=0;
        }
        timer=setTimeout('notice_move()',10000+i*10000);
    }
////通知结束

///自适应分辨率
function pageinit(){
    $("html").height(h);
    $("html").width(w);
    $("body").css({'font-size':1.125*h/1080+"em"});
    $(".line1").css({width:19/64*w+"px"});
    $(".line2").css({marginLeft:7/192*w+"px",width:118/192*w+"px"});
    $(".header").css({paddingLeft:25+"%",height:h*156/1080+"px",width:w+"px",paddingTop:1/36*h+"px",paddingBottom:56/1080*h+"px"});
    $(".hlogo img").css({width:96/192*w+"px"});
    //天气
    $(".hweather").css({width:48/192*w+"px",paddingLeft:156/1920*w+"px",paddingTop:7/1080*h+"px",height:63/1080*h+"px"});
    $(".hw_left").css({width:88/1920*w+"px"});
    $(".hw_right").css({width:177/1920*w+"px"});
    $(".hw_right li").css({height:16/1080*h+"px"});
    $(".hw_right b").css({width:104/1920*w+"px",height:34/1080*h+"px",paddingLeft:1/1920*w+"px",marginTop:6/1080*h+"px",'line-height':34/1080*h+"px"});
    $(".hw_right_t").css({height:19/540*h+"px"});
    $(".hw_right_t span").css({width:27/1920*w+"px",height:18/1080*h+"px",paddingLeft:6/1920*w+"px",paddingTop:6/1080*h+"px"});
    $(".hw_right_t small").css({width:71/1920*w+"px",'line-height':9/1080*h+"px",height:9/1080*h+"px"});
    $(".body_center").css({paddingLeft:5/192*w+"px",width:w+"px",paddingRight:5/192*w+"px",height:924/1080*h+"px"});
    $(".hlogo").css({height:h*7/108+"px",width:0.5*w+"px"});
    ///头部logo
    $(".kp_header").css({height:h*80/1080+"px",marginBottom:50/1080*h+"px"});
    $(".header_logo .logo_bg_left").css({width:206/1920*w+"px"});
    //$(".header_logo .logo").css({width:70/1920*w+"px",height:70/1920*w+"px",marginTop:0/1080*h+"px",marginLeft:-122/1920*w+"px"});
    //$(".header_logo .logo_txt").css({'font-size':1.75*h/1080+"em",width:246/1920*w+"px",height:49/1080*h+"px",marginTop:18/1080*h+"px",marginLeft:-46/1920*w+"px",marginRight:15/1920*w+"px"});
    $(".header_logo .logo_title").css({'font-size':2.5*h/1080+"em",marginTop:0/1080*h+"px",marginLeft:-95/1920*w+"px",marginRight:-200/1920*w+"px"});
    $(".header_logo .logo_bg_right").css({width:235/1920*w+"px",marginRight:25/1920*w+"px"});

    //天气
    $(".kp_date").css({right:50/1920*w+"px"});
    $(".kp_weather").css({marginRight:10/1920*w+"px",'font-size':1.25*h/1080+"em"});
    $("#kp_clock").css({'font-size':1.25*h/1080+"em"});
    $("#t_h").css({'font-size':2.5*h/1080+"em"});
    $("#t_m").css({'font-size':2.5*h/1080+"em"});
    $("#t_s").css({'font-size':1.25*h/1080+"em"});
    $("#t_current").css({'font-size':0.625*h/1080+"em"});






    //公共
    $(".b-title img").css({width:29/1920*w+"px",height:33/1080*h+"px"});
    $(".b-title").css({height:33/1080*h+"px",'line-height':33/1080*h+"px"});//,marginBottom:3/135*h+"px",marginTop:1/45*h+"px"
    //借阅排行榜
    $(".box11 ").css({height:454/1080*h+"px"});
    $(".box11 .b-content").css({height:421/1080*h+"px"});
    $(".box11 .b-content-ub").css({marginTop:2/108*h+"px"});
    $(".box11 .b-con-list").css({height:168/1080*h+"px",paddingLeft:1/1920*w+"px",paddingRight:1/1920*w+"px",paddingTop:6/1080*h+"px"});
    $(".rounded-list ul").css({width:568/1920*0.5*w+"px"});
    $(".rounded-list li").css({'line-height':3/108*h+"px"});
    $(".rounded-list li span").css({width:18/1920*w+"px",height:18/1080*h+"px",'line-height':18/1080*h+"px"});
    $(".rounded-list li:last-child").css({marginBottom:0+"px"});
    $(".zy-Slide1").css({height:252/1080*h+"px"});
    $(".divide-line1").css({height:h*35/1080+"px",width:19/64*w+"px"});
    //借还书系统
    $(".box12").css({height:385/1080*h+"px"});
    $(".box12 .b-content").css({height:33/108*h+"px",marginTop:22/1080*h+"px"});
    $(".box12 .b-content-up").css({height:8/108*h+"px"});
    $("#main1").css({width:57/192*w+"px",height:285/1080*h+"px",marginTop:21/1080*h+"px"});
    $("#main1 div").css({cursor:"none"});
    //到馆统计
    $(".l2-up").css({height:458/1080*h+"px"});
    $(".box21").css({height:458/1080*h+"px",width:376/1920*w+"px"});
    $(".box21 p").css({height:28/1080*h+"px"});
    $(".lbar-warp").css({height:256/1080*h+"px",width:22/1920*w+"px",'border-radius':11/1920*w+"px",marginBottom:10/1080*h+"px"});
    $(".lbar-warp .default").css({'border-radius':11/1920*w+"px",width:22/1920*w+"px",'max-height':256/1080*h+"px"});
    $(".lbar-warp .tipso_bubble").css({height:40/1080*h+"px",'line-height':40/1080*h+"px",'border-radius':6/1920*w+"px",top:-48/1080*h+"px"});
    $(".lbar-warp .tipso_arrow").css({'border-width':8/1920*w+"px",marginLeft:-8/1920*w+"px"});
    $(".divide-line2-1").css({height:31/1080*h+"px"});
    $(".box21 .b-content").css({height:368/1080*h+"px",marginTop:57/1080*h+"px"});
    $(".box21 .b-content-ub").css({marginTop:11/1080*h+"px"});
    $(".box21 .b-content-up").css({height:294/1080*h+"px"});
    $(".bar-warp").css({'border-radius':2/192*w+"px",height:40/1080*h+"px",'line-height':40/1080*h+"px"});
    $(".bar-warp .default").css({'border-radius':20/1920*w+"px",paddingLeft:20/1920*w+"px"});
    $(".b-content-ub  p").css({paddingLeft:11/1080*h+"px"});
    //本馆风采
    $(".box22").css({height:458/1080*h+"px",width:736/1920*w+"px",marginLeft:68/1920*w+"px"});
    $(".box22 .b-content").css({marginTop:30/1080*h+"px",height:396/1080*h+"px"});
    $(".divide-line2-2").css({height:33/1080*h+"px"});
    $(".box22 .b-content-u p").css({paddingLeft:10/1920*w+"px"});
    $(".banner_img_desName").css({bottom:0/1080*h+"px",left:30/1920*w+"px",zIndex:99999});
    $('.swiper-container-horizontal > .swiper-pagination-bullets, .swiper-pagination-custom, .swiper-pagination-fraction').css({bottom:0});
    //今日推荐
    $(".box23").css({width:515/1920*w+"px",height:433/1080*h+"px"});
    $(".box23 .b-content").css({height:400/1080*h+"px"});
    $(".b23-con-img").css({width:281/1920*w+"px",height:321/1080*h+"px",marginRight:54/1920*w+"px",marginTop:29/1080*h+"px"});
    //$(".b23-con-img li p").css({paddingTop:5/1080*h+"px",bottom: 0/1080*h+"px"});

    $(".b23-con-right").css({width:170/1920*w+"px",height:214/1080*h+"px",marginTop:108/1080*h+"px"});
    $(".b23-sline").css({top:-8/1080*h+"px",width:6/1920*w+"px",height:23/1080*h+"px"});
    $(".b23-up p").css({paddingTop:12/1080*h+"px"});
    $(".rad-prg").css({Top:7/108*h+"px",'line-height':24/1080*h+"px"});
    $(".b23-up").css({height:68/1080*h+"px"});
    $(".rad-prg").css({marginTop:1/108*h+"px"});
    //通知
    $(".box32").css({height:433/1080*h+"px",width:579/1920*w+"px",marginLeft:86/1920*w+"px"});
    $(".box32 .b-content").css({height:350/1080*h+"px",paddingTop:21/1080*h+"px"});
    $(".b32-header").css({height:48/1080*h+"px",width:281/1920*w+"px",'line-height':48/1080*h+"px"});
    $(".b32-content").css({height:300/1080*h+"px",marginTop:-18/1080*h+"px"});
    $(".myBlock").css({height:27/108*h+"px",paddingTop:3/108*h+"px",paddingLeft:4/192*w+"px",paddingBottom:0/192*w+"px",paddingRight:4/192*w+"px"});
    $(".myBlock_inner div").css({top:0/1080*h+"px"});
    //$(".b32-content .limarquee").css({height:27/108*h+"px"});
    //$(".b32-content ul li span").css({height:48/1080*h+"px",'line-height':48/1080*h+"px"});
    $(".divide-line3-2").css({height:33/1080*h+"px"});
}
////发ajax请求天气数据和日期显示
function weather_date(address){
    getweather(address);
    var timer = null;
    showTime();
    timer = setInterval(showTime,1000);//绑定计时器。一秒钟调用一次函数，动态刷新时间
}
function getweather(p){
    $.ajax({
        url:"http://api.map.baidu.com/telematics/v3/weather",
        type:"get",
        data:{
            location:p,
            output:'json',
            ak:'6tYzTvGZSOpYB5Oc2YGGOKt8'
        },
        /*预期服务器端返回的数据类型，假设我现在跨域了，我就改成jsonp 就可以了 */
        dataType:"jsonp",
        success:function(data){
            var weatherData=data.results[0].weather_data;
            $("#kplace").text(p);
            //if(weatherData[0].weather.length!=undefined&&weatherData[0].weather.length>=6){
            //    $(".hw_left").width(10/192*w);
            //}
            $("#kpweather").text(weatherData[0].weather);
            $("#kptemp").text(weatherData[0].temperature);
        }
    })
}
function showTime() {
    var today = new Date(); //新建一个Date对象
    var date = today.getDate();//查询当月日期
    var day = today.getDay();//查询当前星期几
    var month = today.getMonth() + 1;//查询月份
    var year = today.getFullYear();//查询年份
    var hour = today.getHours();
    var min = today.getMinutes();
    var sec = today.getSeconds();
    var week = "";
    if (day == 0) week = '星期日';
    if (day == 1) week = '星期一';
    if (day == 2) week = '星期二';
    if (day == 3) week = '星期三';
    if (day == 4) week = '星期四';
    if (day == 5) week = '星期五';
    if (day == 6) week = '星期六';
    if(hour<10){
        hour='0'+hour;
    }
    if(min<10){
        min='0'+min;
    }
    if(sec<10){
        sec='0'+sec;
    }
    $('#kp_clock').html(year + "年" + month + "月" + date + "日 " + week);
    $('#t_h').html(hour + ":");
    $('#t_m').html( min );
    $('#t_s').html(sec);

}














